package cn.gzjp.modules.logis.service;

import java.util.List;

import cn.gzjp.modules.logis.entity.LogisUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.logis.entity.LogisInsurePhoto;
import cn.gzjp.modules.logis.dao.LogisInsurePhotoDao;

/**
 * 货运保险Service
 * @author zengcp
 * @version 2018-04-28
 */
@Service
@Transactional(readOnly = true)
public class LogisInsurePhotoService extends CrudService<LogisInsurePhotoDao, LogisInsurePhoto> {

	public LogisInsurePhoto get(String id) {
		return super.get(id);
	}
	
	public List<LogisInsurePhoto> findList(LogisInsurePhoto logisInsurePhoto) {
		return super.findList(logisInsurePhoto);
	}
	
	public Page<LogisInsurePhoto> findPage(Page<LogisInsurePhoto> page, LogisInsurePhoto logisInsurePhoto) {
		return super.findPage(page, logisInsurePhoto);
	}
	
	@Transactional(readOnly = false)
	public void save(LogisInsurePhoto logisInsurePhoto) {
		LogisInsurePhoto m = get(logisInsurePhoto.getId());
		if(m!=null){
			super.save(logisInsurePhoto);
		}else{
			super.insert(logisInsurePhoto, logisInsurePhoto.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(LogisInsurePhoto logisInsurePhoto) {
		super.deleteByLogic(logisInsurePhoto);
	}
	
}